/*
 *************************************************************************
 *西瑞克斯研发管理系统
 *版 本: 1.0   
 *日 期：02/16/2012    
 *作 者： 王浩 QQ：873987060   
 *************************************************************************   
 */
package com.application.yfapplycost.entity;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import com.manager.IBaseBean;
import com.manager.commons.CommonUtil;
import com.manager.commons.StringUtil;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 
 * Description:YfApplyCost实体<br />
 * 
 * Version:V0.1<br />
 * 
 * Author: 王浩 QQ：873987060 <br />
 * 
 * History: <br />
 * 
 * 02/16/2012
 * 
 */
@Entity
@Table(name = "yf_apply_cost")
public class YfApplyCost implements IBaseBean {

	/** serialVersionUID */
	protected static final long serialVersionUID = -1L;

	public YfApplyCost() {

	}

	@Id
	@Column(name = "id")
	private String id; // $field.label

	@Column(name = "project_no")
	private String projectNo; // $field.label

	@Column(name = "apply_no")
	private String applyNo; // $field.label

	@Column(name = "apply_cause")
	private String applyCause; // $field.label

	@Column(name = "apply_date")
	private Date applyDate; // $field.label

	@Column(name = "apply_money")
	private BigDecimal applyMoney; // $field.label

	@Column(name = "fee_type")
	private Long feeType; // $field.label

	@Column(name = "audit_status")
	private Long auditStatus; // $field.label

	@Column(name = "process_id")
	private String processId; // $field.label

	@Column(name = "org")
	private String org; // $field.label

	@Column(name = "operateid",updatable=false)
	private String operateid; // $field.label

	@Column(name = "create_date")
	private Date createDate; // $field.label

	@Transient
	private String projectName;
	@Transient
	private String projectOrg;
	@Transient
	private Long projectType;
	@Transient
	private String workItemId;
	@Transient
	private String applyDateStr;
	
	@Transient
	private String feeTypeStr;
	
	@Transient
	private String exportType;
	
	@Transient
	private String rname;
	
	
	@Transient
	private String printPerson;
	
	@Transient
	private String printDate;

	public String getFeeTypeStr() {
		if(feeType!=null){
			return CommonUtil.getDictValue(feeType.intValue(), "FEE_TYPE");
		}
		return " ";
	}

	public void setFeeTypeStr(String feeTypeStr) {
		this.feeTypeStr = feeTypeStr;
	}

	/**
	 * ${field.getLabel()}
	 * 
	 * @return Returns the Id.
	 */
	public String getId() {
		return this.id;
	}

	/**
	 * @param id
	 *            Set the id.
	 */
	public void setId(String id) {
		this.id = id;
	}

	/**
	 * ${field.getLabel()}
	 * 
	 * @return Returns the ProjectNo.
	 */
	public String getProjectNo() {
		return this.projectNo;
	}

	/**
	 * @param projectNo
	 *            Set the projectNo.
	 */
	public void setProjectNo(String projectNo) {
		this.projectNo = projectNo;
	}

	/**
	 * ${field.getLabel()}
	 * 
	 * @return Returns the ApplyNo.
	 */
	public String getApplyNo() {
		return this.applyNo;
	}

	/**
	 * @param applyNo
	 *            Set the applyNo.
	 */
	public void setApplyNo(String applyNo) {
		this.applyNo = applyNo;
	}

	/**
	 * ${field.getLabel()}
	 * 
	 * @return Returns the ApplyCause.
	 */
	public String getApplyCause() {
		return this.applyCause;
	}

	/**
	 * @param applyCause
	 *            Set the applyCause.
	 */
	public void setApplyCause(String applyCause) {
		this.applyCause = applyCause;
	}

	/**
	 * ${field.getLabel()}
	 * 
	 * @return Returns the ApplyDate.
	 */
	public Date getApplyDate() {
		return this.applyDate;
	}

	/**
	 * @param applyDate
	 *            Set the applyDate.
	 */
	public void setApplyDate(Date applyDate) {
		this.applyDate = applyDate;
	}

	/**
	 * ${field.getLabel()}
	 * 
	 * @return Returns the ApplyMoney.
	 */
	public BigDecimal getApplyMoney() {
		return this.applyMoney;
	}

	/**
	 * @param applyMoney
	 *            Set the applyMoney.
	 */
	public void setApplyMoney(BigDecimal applyMoney) {
		this.applyMoney = applyMoney;
	}

	/**
	 * ${field.getLabel()}
	 * 
	 * @return Returns the FeeType.
	 */
	public Long getFeeType() {
		return this.feeType;
	}

	/**
	 * @param feeType
	 *            Set the feeType.
	 */
	public void setFeeType(Long feeType) {
		this.feeType = feeType;
	}

	/**
	 * ${field.getLabel()}
	 * 
	 * @return Returns the AuditStatus.
	 */
	public Long getAuditStatus() {
		return this.auditStatus;
	}

	/**
	 * @param auditStatus
	 *            Set the auditStatus.
	 */
	public void setAuditStatus(Long auditStatus) {
		this.auditStatus = auditStatus;
	}

	/**
	 * ${field.getLabel()}
	 * 
	 * @return Returns the ProcessId.
	 */
	public String getProcessId() {
		return this.processId;
	}

	/**
	 * @param processId
	 *            Set the processId.
	 */
	public void setProcessId(String processId) {
		this.processId = processId;
	}

	/**
	 * ${field.getLabel()}
	 * 
	 * @return Returns the Org.
	 */
	public String getOrg() {
		return this.org;
	}

	/**
	 * @param org
	 *            Set the org.
	 */
	public void setOrg(String org) {
		this.org = org;
	}

	/**
	 * ${field.getLabel()}
	 * 
	 * @return Returns the Operateid.
	 */
	public String getOperateid() {
		return this.operateid;
	}

	/**
	 * @param operateid
	 *            Set the operateid.
	 */
	public void setOperateid(String operateid) {
		this.operateid = operateid;
	}

	/**
	 * ${field.getLabel()}
	 * 
	 * @return Returns the CreateDate.
	 */
	public Date getCreateDate() {
		return this.createDate;
	}

	/**
	 * @param createDate
	 *            Set the createDate.
	 */
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public String toString() {
		return ReflectionToStringBuilder.toString(this,
				ToStringStyle.MULTI_LINE_STYLE);
	}

	public String getProjectName() {
		return projectName;
	}

	public void setProjectName(String projectName) {
		this.projectName = projectName;
	}

	public String getProjectOrg() {
		return projectOrg;
	}

	public void setProjectOrg(String projectOrg) {
		this.projectOrg = projectOrg;
	}

	public Long getProjectType() {
		return projectType;
	}

	public void setProjectType(Long projectType) {
		this.projectType = projectType;
	}

	public String getWorkItemId() {
		return workItemId;
	}

	public void setWorkItemId(String workItemId) {
		this.workItemId = workItemId;
	}

	public String getApplyDateStr() {
		String re = "";
		if (this.applyDate == null) {
			return re;
		}
		try {
			re = StringUtil.dateToString(this.applyDate);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return re;

	}

	public void setApplyDateStr(String applyDateStr) {
		this.applyDateStr = applyDateStr;
	}

	public String getExportType() {
		if(StringUtils.isBlank(projectNo)){
			return "nomarl";
		}
		return "project";
	}

	public void setExportType(String exportType) {
		this.exportType = exportType;
	}

	public String getRname() {
		return rname;
	}

	public void setRname(String rname) {
		this.rname = rname;
	}

	public String getPrintPerson() {
		return printPerson;
	}

	public void setPrintPerson(String printPerson) {
		this.printPerson = printPerson;
	}

	public String getPrintDate() {
		return printDate;
	}

	public void setPrintDate(String printDate) {
		this.printDate = printDate;
	}
}
